#ifndef VSCOMMAND_H
#define VSCOMMAND_H
#include "VSMath.h"
#include "VSString.h"
#include "VSMemManager.h"
#include "VSSystem.h"
// #ifdef VSAPPLICATION_EXPORTS
// #define VSAPPLICATION_API __declspec(dllexport) 
// #else 
// #define VSAPPLICATION_API __declspec(dllimport) 
// #endif
namespace VSEngine2
{
	class /*VSAPPLICATION_API*/ VSCommand : public VSMemObject
	{
	public:

		VSCommand (int numArguments, TCHAR** arguments);
		VSCommand (TCHAR* commandLine);
		~VSCommand ();



		VSCommand& Min (VSREAL value);
		VSCommand& Max (VSREAL value);


		int GetBoolean (const TCHAR* name);  // returns existence of option
		int GetBoolean (const TCHAR* name, bool& value);
		int GetInteger (const TCHAR* name, int& value);
		int GetReal (const TCHAR* name, VSREAL& value);
		int GetString (const TCHAR* name, VSString & value);

		// Last-error reporting.
		const TCHAR* GetLastError ();

	protected:


		// Support for construction.
		void Initialize ();

		// VSCommand line information.
		int mNumArguments;   // number of arguments
		TCHAR** mArguments;   // argument list (array of strings)


		// Parameters for bounds checking.
		VSREAL mSmall;    // lower bound for numerical argument (min or inf)
		VSREAL mLarge;    // upper bound for numerical argument (max or sup)
		bool mMinSet;  // if true, compare:  small <= arg
		bool mMaxSet;  // if true, compare:  arg <= large

		// Last-error strings.
		const TCHAR* mLastError;
		static TCHAR msOptionNotFound[];
		static TCHAR msArgumentRequired[];
		static TCHAR msArgumentOutOfRange[];
		class Argument
		{
		public:
			Argument (TCHAR* item, Argument* next)
			{
				Item = item;
				Next = next;
			}
			~Argument ()
			{

			}

			TCHAR* Item;
			Argument* Next;
		};
	};
}
#endif